﻿//using System;
//using System.Dynamic;
//using Microsoft.VisualStudio.TestTools.UnitTesting;
//using Newtonsoft.Json;
//using Payment.Weixin2;
//using WebCommon.Com;
//using WebCommon.Extensions;


//namespace Tests
//{
//    using System.Diagnostics;

 

//    using Payment.Albaba.Com;
//    using Payment.Albaba.PcCode;
//    using Payment.Albaba.WapCode;
//    using Payment.ChinaPay;
//    using Payment.Weixin;

//    using WebCommon;

//    [TestClass]
//    public class UnitTest1
//    {
//        [TestMethod]
//        public void Getimg()
//        {
//            var stringToBase64 = Static.StringToBase64("陆永明");
//            Debug.WriteLine(stringToBase64);
//            var bts = Static.Base64ToString("6ZmG5rC45piO");
//            Debug.WriteLine(bts);
//        }


//        [TestMethod]
//        public void TestMethod1()
//        {
//            var wxConfig = new WxConfig();
//            wxConfig.AppId = "wx53f182f19b9afdab";
//            wxConfig.Appkey = "3916C2g469K3lHvKFyKMutf7yHWDW0zRkN31mQ5FsJieib79jiCImUo7JdKeEdL5mwCPwmpTW5qkgTnQFq0RkC2sfkAxNKq1L3Gd3YlUEs89jl8hDT1AXM8FzCCbeSGf";
//            wxConfig.PartnerKey = "bfe5cc43c8ee32a1416bb9027f97c025";
//            wxConfig.Partner = "1219356801";
//            var order = new PayOrder();
//            var wxPackage = new WxPackage(order, wxConfig);
//            wxPackage.SpbillCreateIp = "192.168.6.106";
//            wxPackage.NotifyUrl = "http://m.jjss.365.com/zhifu";
//            var wxResponseJsApi = new WxResponseJsApi(wxConfig, wxPackage);

//            wxResponseJsApi.NonceStr = "scaibcinja";
//            wxResponseJsApi.TimeStamp = "1420366619";

//            Debug.Write(wxResponseJsApi.Fasong());
//        }

//        [TestMethod]
//        public void Rnum()
//        {
//            Debug.Write(RandomsAzNum.GetLun(16));
//        }

//        [TestMethod]
//        public void sha1()
//        {
//            var s = "appid=wx53f182f19b9afdab&appkey=3916C2g469K3lHvKFyKMutf7yHWDW0zRkN31mQ5FsJieib79jiCImUo7JdKeEdL5mwCPwmpTW5qkgTnQFq0RkC2sfkAxNKq1L3Gd3YlUEs89jl8hDT1AXM8FzCCbeSGf&noncestr=scaibcinja&package=bank_type=WX&body=%E6%B5%8B%E8%AF%95%E5%95%86%E5%93%81&fee_type=1&input_charset=UTF-8&notify_url=http%3A%2F%2Fm.jjss.365.com%2Fzhifu&out_trade_no=852666666666954122&partner=1219356801&spbill_create_ip=192.168.6.106&total_fee=222&sign=67A463A714C3D292B0C3A62312B23E2A&timestamp=1420366619";
//            Debug.Write(WebCommon.Encryption.Sha1(s));
//        }


//        [TestMethod]
//        public void Wxurl()
//        {
//            var wxConfig = new WxConfig();
//            wxConfig.AppId = "wx53f182f19b9afdab";
//            wxConfig.Appkey = "3916C2g469K3lHvKFyKMutf7yHWDW0zRkN31mQ5FsJieib79jiCImUo7JdKeEdL5mwCPwmpTW5qkgTnQFq0RkC2sfkAxNKq1L3Gd3YlUEs89jl8hDT1AXM8FzCCbeSGf";
//            wxConfig.PartnerKey = "bfe5cc43c8ee32a1416bb9027f97c025";
//            wxConfig.AppSecret = "640b29b228bd5b584a0527803e7c536c";

//            var order = new PayOrder();
//            var wxPackage = new WxPackage(order, wxConfig);
//            wxPackage.SpbillCreateIp = "192.168.6.106";

//            var wxResponseUrl = new WxResponseUrl(wxConfig, wxPackage);

//            Debug.Write(wxResponseUrl.Fasong());
//        }
//        [TestMethod]
//        public void aliurl()
//        {
//            var s = "b942cf971a85c01ecd042f8f8597eb242e";
//            var p = "2088412959027467";
//            string veryfy_url = "https://mapi.alipay.com/gateway.do?service=notify_verify&" + "partner=" + p + "&notify_id=" + s;

//            // 获取远程服务器ATN结果，验证是否是支付宝服务器发来的请求
//            var httpHelper = new WebCommon.HttpHelper();
//            httpHelper.Url = veryfy_url;
//            httpHelper.Method = true;
//            httpHelper.Data = string.Empty;
//            string postPage = httpHelper.PostPage().ToString();

//            Debug.Write(postPage);
//        }

//        [TestMethod]
//        public void AliWap()
//        {
//            var aliSeller = new AliSeller();
//            aliSeller.SellerEmail = "pixidianli@163.com";
//            aliSeller.SellerId = "2088801113814216";

//            var aliPayService = new AliWapService(new PayOrder(), aliSeller);

//            var alp = new AliWapSubmit(config, aliPayService);
//            alp.SetData();
//            var fasong = alp.Fasong();

//            Debug.Write(fasong);
//        }

//        /// <summary>
//        /// 支付宝配置信息
//        /// </summary> 
//        private AliConfig config
//        {
//            get
//            {
//                var aliPayConfig = new AliConfig("2088801113814216", "vaktbn46ymip6aj3j8glv6njuu3pvjhu");
//                aliPayConfig.ReturnUrl = "http://211.102.90.166:1001/ali/returl";
//                aliPayConfig.NotifyUrl = "http://211.102.90.166:1001/ali/Notify";
//                return aliPayConfig;
//            }
//        }

//        [TestMethod]
//        public void Chinapay()
//        {
//            var payService = new PayService(new PayOrder());
//            payService.ReturnUrl = "http://211.102.90.166:1001/ali/returl";
//            payService.NoticeUrl = "http://211.102.90.166:1001/ali/Notify";
//            var paySub = new PaySub(payService, chinapayconfig);


//            paySub.SetData();
//            var fasong = paySub.Fasong();
//            Debug.Write(fasong);
//        }

//        [TestMethod]
//        public void num()
//        {
//            int q = 5555;
//            Debug.Write(q.ToString("D12"));
//        }

//        /// <summary>
//        /// 配置文件
//        /// </summary>
//        private ChinaPayConfig chinapayconfig
//        {
//            get
//            {
//                var aliPayConfig = new ChinaPayConfig("808080232802634", "D:/ceshimiyao/B2C/MerPrK_808080232802634_20121126163117.key");

//                return aliPayConfig;
//            }
//        }

//        [TestMethod]
//        public void Fenzhang()
//        {
//            var payService = new PayService(new PayOrder());
//            payService.NoticeUrl = "http://yinlianpc/Notify";
//            payService.ReturnUrl = "http://yinlianpc/returl";
//            var paySub = new PayFenzhangSub(payService, this.fenzhangconfig);
//            paySub.Gateway = "http://bianmin-test.chinapay.com/cpeduinterface/OrderGet.do";
//            paySub.ShareData = "A^10;B^10;";
//            paySub.SetData();
//            var Ex1 = paySub.operation.PlainDataB64;
//            var Ex2 = paySub.operation.PlainData;

//            Debug.WriteLine(Ex1);
//            Debug.WriteLine(Ex2);

//        }

//        /// <summary>
//        /// 设置
//        /// </summary>
//        private ChinaPayConfig fenzhangconfig
//        {
//            get
//            {
//                var aliPayConfig = new ChinaPayConfig("808080050792904", @"D:\ceshimiyao\px\测试无卡\MerPrK_808080050792904_20130507163317.key");

//                return aliPayConfig;
//            }
//        }

//        [TestMethod]
//        public void Dec()
//        {
//            var desDecrypt = Encryption.DesEncryption("asdsadsssssad", "qweasdzx", "12312312");
//            Debug.WriteLine(desDecrypt);
//        }

//        [TestMethod]
//        public void Excel()
//        {
//            var dt = ExcelHelper.GetExcelContent("D://t.xls", "Sheet1");
//            var serializeObject = JsonConvert.SerializeObject(dt);

//            Debug.WriteLine(serializeObject);
//        }

//        [TestMethod]
//        public void Only()
//        {
//            OnlyId.OnlyTime16();
//            Debug.WriteLine(OnlyId.OnlyTicks(1000));
//            Debug.WriteLine(OnlyId.OnlyTicks(1000));
//            Debug.WriteLine(OnlyId.OnlyTicks(1000));
//            Debug.WriteLine(OnlyId.OnlyTicks(1000));
//            Debug.WriteLine(OnlyId.OnlyTicks(1000));
//            Debug.WriteLine(OnlyId.OnlyTicks(1000));
//        }

//        private Payment.Weixin2.WxConfig wxc2
//        {
//            get
//            {
//                var wx2 = new Payment.Weixin2.WxConfig();
//                wx2.AppId = "wx62fa9f7c0f4a0e8e";
//                wx2.Mchid = "1235216302";
//                wx2.Key = "MIIEowIBAAKCAQEAn/cRT1nh9JM5eTsbL2rKDO+zhX/dBKy8VHEokBg4pFQp4an9KYqZSJgxZ8zFJ5vwoB81tSuhH9jbyjYxjPEkPMGhPpshH3CRc+bbFBnRJ9HhmGq5IZDmYBvWfQOn2Uk7HwHg+oJ/NwoBg9iH/RW1Ow1mc50ljoSndLATEKxokt21dGqcLv9FonS1ERoH3e2KgKyVfTfGX/lGknt1YUft27G5sVTjEkdsTy0PlPYq7eKT6zdoGid5JKakEpWlffOU/PYb24Zn4FnNGrI8n2mhQlSxU3/1ZsQY2cflI8Rqi71dSmDX/Dlt2Iq3It5BAEHfxQ87jXz2xjWLRsZkCd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h5mfkSPX+r8vb/gPYStaiBau7c8zORCdB6obVXZA8jJv+WOihL+ZtJst4fQQ3FmhRPvyevH6KfdxyIaOn+cI0SxQYTeu/N0sTEGn7ZYEfpukqm23OzZeTJy4HldCNkqR7RXe/GRMrWUuWIzuzQx0g8";
//                wx2.NotifyUrl = "http://zf.xxx.com/wx2/Notify";
//                wx2.Appsecret = "9d8ec510261f36ccdfdb263ce3e72ef2";
//                return wx2;
//            }
//        }

//        [TestMethod]
//        public void Wx2Test()
//        {
//            var str = Payment.Weixin2.WxCommon.GetCodeUrl(wxc2, "http://zf.iesympt.cn/wx2/gopay?sysorderid=5672752649548882", "5672752649548882");

//            Debug.Write(str);
//        }

//        [TestMethod]
//        public void test()
//        {
//            var jr = new JsonReturn("asd");

//        }
//    }
//}
